package com.atguigu.gmall.search.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.FileDescriptor;

/**
 * @Description
 * @Return
 * @Author https://weiranyi.github.io
 * @Date Created in 2022-12-12 12:55
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "/person") //这是一个文档，在/person索引下
public class Person {
    @Id //主键
    private Integer id;
    // 文本字段能全文检索
    @Field(value = "name",type = FieldType.Text)
    private String name;
    private String sex;
    // 年龄字段
    @Field(value = "age",type = FieldType.Integer)
    private Integer age;
}
